<html>
<head>
	<title>Excersise 2</title>
	<link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
	<div id="js-console"></div>
	<script src="scripts/js-console.js"></script>
	<script>

	function lastDigitName(number)
	{
		var index=0;
		var digits = new Array;
		var numStr = number.toString();
		for (i=numStr.length-1;i >= 0;i--)
		{
		digits[index] = numStr.charAt(i);
			index++;
		}
			jsConsole.write("input number is: " + number + ", and oposite number is: ");
		for (j=0;j<numStr.length;j++)
		{
			jsConsole.write(digits[j]);				
		}
		jsConsole.writeLine();			
	}
	var number = 123;
	lastDigitName(number);
	var number = 4114;
	lastDigitName(number);	
	var number = 15121;
	lastDigitName(number);	
	var number = 11356;
	lastDigitName(number);
	</script>
</body>
</html>
